<%@page language="java" contentType="text/html; charset=utf-8"%>
<%@include file="/commons/inc.jsp" %>

<h3 id="navTitleId">生育史</h3>

<body id="body">

<script>
function changeInput(selectid,inputid,voidindex){
	var select = document.getElementById(selectid);
	var input = document.getElementById(inputid);
	if(voidindex==select.options.selectedIndex){
		input.disabled=true;
	}else{
		input.disabled=false;
	}
}
</script>

<%@include file="/commons/showmessage.jsp" %>

<form name="bearform" id="bearform" method="post" action="${contextPath}/bear/bear.action?method=saveEditBear">
	<s:hidden name="bear.bearid" id="bear.bearid"></s:hidden>
	<s:hidden name="bear.patientid" id="bear.patientid"></s:hidden>
	<s:hidden name="patientid" id="patientid"></s:hidden>
	
	<table border="0" cellspacing="1" cellpadding="0" class="formTable" width="100%" >
		<tr>
			<td class="form-td"><label class="label">正常分娩:</label></td>
			<td class="form-td"><select name="bear.fenmian" id="bear.fenmian" onchange="changeInput('bear.fenmian','bear.fmcount',1)">
					<option value="0" <s:if test="bear.fenmian == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="bear.fenmian == 1">selected</s:if>>是</option>
					<option value="2" <s:if test="bear.fenmian == 2">selected</s:if>>否</option>
				</select></td>
			<td class="form-td"><select name="bear.fmcount" id="bear.fmcount">
				 	<s:iterator value="new int[10]" id="ind" status="st">
			 			<option value="<s:property value="#st.index+1"/>" <s:if test="bear.fmcount == #st.index+1">selected</s:if>><s:property value="#st.index+1"/></option>	 
			 		</s:iterator>
				</select></td>	 
				
			<td class="form-td"><label class="label">妊娠高血压史:</label></td>
			<td class="form-td"><select name="bear.rensheny" id="bear.rensheny" onchange="changeInput('bear.rensheny','bear.rsycount',0)">
					<option value="0" <s:if test="bear.rensheny == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="bear.rensheny == 1">selected</s:if>>无</option>
					<option value="2" <s:if test="bear.rensheny == 2">selected</s:if>>有</option>
					<option value="3" <s:if test="bear.rensheny == 3">selected</s:if>>不详</option>
				</select></td>
			<td class="form-td"><select name="bear.rsycount" id="bear.rsycount">
				 	<s:iterator value="new int[5]" id="ind" status="st">
			 			<option value="<s:property value="#st.index+1"/>" <s:if test="bear.rsycount == #st.index+1">selected</s:if>><s:property value="#st.index+1"/></option>	 
			 		</s:iterator>
				</select></td>	 
			
			<td class="form-td"><label class="label">妊娠高血糖史:</label></td>
			<td class="form-td"><select name="bear.renshent" id="bear.renshent" onchange="changeInput('bear.renshent','bear.rstcount',0)">
					<option value="0" <s:if test="bear.renshent == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="bear.renshent == 1">selected</s:if>>无</option>
					<option value="2" <s:if test="bear.renshent == 2">selected</s:if>>有</option>
					<option value="3" <s:if test="bear.renshent == 3">selected</s:if>>不详</option>
				</select></td>
			<td class="form-td"><select name="bear.rstcount" id="bear.rstcount">
				 	<s:iterator value="new int[5]" id="ind" status="st">
			 			<option value="<s:property value="#st.index+1"/>" <s:if test="bear.rstcount == #st.index+1">selected</s:if>><s:property value="#st.index+1"/></option>	 
			 		</s:iterator>
				</select></td>	 
		</tr>
		 
		<tr>
			<td class="form-td"><label class="label">宫外孕史:</label></td>
			<td class="form-td"><select name="bear.gongwai" id="bear.gongwai" onchange="changeInput('bear.gongwai','bear.gwcount',0)">
					<option value="0" <s:if test="bear.gongwai == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="bear.gongwai == 1">selected</s:if>>无</option>
					<option value="2" <s:if test="bear.gongwai == 2">selected</s:if>>有</option>
					<option value="3" <s:if test="bear.gongwai == 3">selected</s:if>>不详</option>
				</select></td>
			<td class="form-td"><select name="bear.gwcount" id="bear.gwcount">
				 	<s:iterator value="new int[5]" id="ind" status="st">
			 			<option value="<s:property value="#st.index+1"/>" <s:if test="bear.gwcount == #st.index+1">selected</s:if>><s:property value="#st.index+1"/></option>	 
			 		</s:iterator>
				</select></td>	 
				
			<td class="form-td"><label class="label">生育巨大胎儿史<br>（出生体重＞4.0Kg）:</label></td>
			<td class="form-td"><select name="bear.taier" id="bear.taier" onchange="changeInput('bear.taier','bear.taiercount',0)">
					<option value="0" <s:if test="bear.taier == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="bear.taier == 1">selected</s:if>>无</option>
					<option value="2" <s:if test="bear.taier == 2">selected</s:if>>有</option>
					<option value="3" <s:if test="bear.taier == 3">selected</s:if>>不详</option>
				</select></td>
			<td class="form-td"><select name="bear.taiercount" id="bear.taiercount">
				 	<s:iterator value="new int[5]" id="ind" status="st">
			 			<option value="<s:property value="#st.index+1"/>" <s:if test="bear.taiercount == #st.index+1">selected</s:if>><s:property value="#st.index+1"/></option>	 
			 		</s:iterator>
				</select></td>	 
			
			<td class="form-td"><label class="label">自然流产史:</label></td>
			<td class="form-td"><select name="bear.liuchan" id="bear.liuchan" onchange="changeInput('bear.liuchan','bear.lccount',0)">
					<option value="0" <s:if test="bear.liuchan == 0">selected</s:if>>请选择</option>
					<option value="1" <s:if test="bear.liuchan == 1">selected</s:if>>无</option>
					<option value="2" <s:if test="bear.liuchan == 2">selected</s:if>>有</option>
					<option value="3" <s:if test="bear.liuchan == 3">selected</s:if>>不详</option>
				</select></td>
			<td class="form-td"><select name="bear.lccount" id="bear.lccount">
				 	<s:iterator value="new int[5]" id="ind" status="st">
			 			<option value="<s:property value="#st.index+1"/>" <s:if test="bear.lccount == #st.index+1">selected</s:if>><s:property value="#st.index+1"/></option>	 
			 		</s:iterator>
				</select></td>	 
		</tr>
		
		<tr>
			<td align="center" colspan="9"> 
			<input type="reset" value="重置"> 
		    <input type="button" onclick="saveEdit('save');" value="保存">
		    <input type="button" onclick="javascript:back();"value="返回列表"></td>
		</tr>
	</table>
</form>

<%@include file="/commons/tableSel.jsp" %>

</body>

<style type="text/css">
body {
	height: 100%;
	width: 100%;
}
</style>

<script>
function back(){
	location.href="${contextPath}/patient/patient.action?method=query";
}
function saveEdit(type){
	if(type=='refresh'){
		location.reload();
	}else if(type=='save'){
		if(!Validator.Validate($('bearform'),3)){
			return;
		}	
		$('bearform').submit();
	}
}
</script>